package com.ruoyi.basedata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ruoyi.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.poi.hpsf.Decimal;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 小档案对象 t_terminals_xb
 *
 * @author ruoyi
 * @date 2023-09-07
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_terminals_xb")
public class TerminalsXb implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 自增主键
     */
    @TableId
    @TableField("id")
//    @JsonProperty("id")
    private Long id;

    /**
     * 设备归属水司
     */
    @TableField("tenant_id")
    @Excel(name = "客户编号")
    private String tenantId;

    @TableField(exist = false)
    @Excel(name = "用户名称", type = Excel.Type.EXPORT)
    private String userName;

    /**
     * 用户编号
     */
    @Excel(name = "用户编号")
//    @JsonProperty("UserId")
    @TableField("user_id")
    private String userId;

    @TableField("location_nb")
    private String locationNb;

    @TableField(exist = false)
    private String newLocationNb;

    @TableField(exist = false)
    private String userAddress;
    /**
     * 门牌号
     */
    @Excel(name = "门牌号", type = Excel.Type.EXPORT)
//    @JsonProperty("InstallAddress")
    @TableField("install_address")
    private String installAddress;

    /**
     * 设备编号
     */
    @Excel(name = "设备编号")
//    @JsonProperty("TerminalId")
    @TableField("terminal_id")
    private String terminalId;

    @TableField(exist = false)
    private String newTerminalId;

    @Excel(name = "IMEI")
//    @JsonProperty("IMEI")
    @TableField("imei")
    private String imei;

    @TableField(exist = false)
    private String newImei;

    @TableField(exist = false)
    @Excel(name = "IMSI(当平台为OneNET时填写)")
    private String imsi;
    /**
     * 区域编号
     */
    @Excel(name = "区域编号", type = Excel.Type.IMPORT)
    @TableField("sheets_code")
    private String sheetsCode;

    @TableField("sheets_id")
    private Integer sheetsId;


    @TableField(exist = false)
    private String sheetsName;
    /**
     * 厂家编号
     */
    //@Excel(name = "厂家编号", dictType = "terminal_supplier")
    @Excel(name = "厂家编号")
//    @JsonProperty("SupplierId")
    @TableField("supplier_id")
    private String supplierId;

    /**
     * 表型号ID
     */
    @Excel(name = "表型号ID",dictType = "module_type")
//    @JsonProperty("TypeID")
    @TableField("type_id")
    private String typeId;

    /**
     * 表底数
     */
    @Excel(name = "表底数", type = Excel.Type.EXPORT)
//    @JsonProperty("BaseReading")
    @TableField("base_reading")
    private BigDecimal baseReading;

    @TableField(exist = false)
    private BigDecimal newBaseReading;

    /**
     * 是否带阀控(0：否，1：是)
     */
    @Excel(name = "是否带阀控", readConverterExp = "0=否,1=是")
    @TableField("valve_control")
    private Long valveControl;

    /**
     * 阀门地址
     */
    @Excel(name = "阀门地址", type = Excel.Type.EXPORT)
//    @JsonProperty("ValveAddress")
    @TableField("valve_address")
    private String valveAddress;

    /**
     * 安装日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd", type = Excel.Type.EXPORT)
//    @JsonProperty("InstallDate")
    @TableField("install_date")
    private Date installDate;

    /**
     * 抄表周期
     */
    @Excel(name = "抄表周期")
//    @JsonProperty("MeterReaderCycle")
    @TableField("meter_reader_cycle")
    private Long meterReaderCycle;


        @Excel(name = "集中器名称")
    @TableField(exist = false)
//    @JsonProperty("ConcentratorName")
    private String concentratorName;

    /**
     * 采集器ID
     */
    @Excel(name = "采集器ID")
//    @JsonProperty("CollectorId")
    @TableField("collector_id")
    private Long collectorId;
    /**
     * 采集器地址
     */
    @Excel(name = "采集器地址")
    @TableField(exist = false)
    private String collectorAddress;

    @Excel(name = "表状态", readConverterExp = "0=停用,1=使用", type = Excel.Type.EXPORT)
    //    @JsonProperty("TerminalMark")
    @TableField("terminal_mark")
    private Integer terminalMark;

    /**
     * 协议id
     */
//    @TableField("protocol_id")
    @Excel(name = "协议ID(2:德高nb,3:汇中nb,4:国信直读表协议,5:四联协议)")
    @TableField("protocol_id")
    private String protocolId;

//    @Excel(name = "表解析地址", type = Excel.Type.EXPORT)
    @Excel(name = "表解析地址")
    @TableField("communicate_address")
    private String communicateAddress;


    @Excel(name = "口径", dictType = "ldbd_pipe_caliber")
    @TableField("terminal_calibre")
    private String terminalCalibre;

    @TableField(exist = false)
    @JsonProperty("calibreValue")
    private String CalibreValue;

    /**
     * 设备的注册平台
     */
    @Excel(name = "注册平台", dictType = "sign_platform")
    @TableField("sign_platform")
    @NotNull(message = "注册平台不能为空")
    private Integer signPlatform;

    @Excel(name = "客户名称")
    @TableField(exist = false)
    private String deptName;
    /**
     * 集中器ID
     */
    @Excel(name = "集中器ID")
//    @JsonProperty("ConcentratorId")
    @TableField("concentrator_id")
    private Long concentratorId;
    /**
     * 集中器地址
     */
    @Excel(name = "集中器地址")
    @TableField(exist = false)
    private String concentratorAddress;

    /**
     * 换表标志(0：否，1：是)
     */
//    @Excel(name = "换表标志(0：否，1：是)", type = Excel.Type.EXPORT)
//    @JsonProperty("ChangeMark")
    @TableField("change_mark")
    private Integer changeMark;

    /**
     * 新表地址
     */
//    @Excel(name = "新表地址", type = Excel.Type.EXPORT)
//    @TableField("Terminal_new")
    @TableField("terminal_new")
    private String terminalNew;

    //    @Excel(name = "计量版电压类型", type = Excel.Type.EXPORT)
    @TableField("voltage_type")
    private String voltageType;

    //    @Excel(name = "计量版电压", type = Excel.Type.EXPORT)
    @TableField("metered_voltage")
    private BigDecimal meteredVoltage;

    //    @Excel(name = "瞬时流量计算方式", type = Excel.Type.EXPORT)
    @TableField("instantaneous_js_fs")
    private String instantaneousJsFs;

    //    @Excel(name = "AEP平台的唯一码", type = Excel.Type.EXPORT)
    @TableField("device_id")
    private String deviceId;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableField("del_flag")
    @TableLogic(value = "0",delval = "2")
    private Integer delFlag;

    /**
     * 备注
     */
    @TableField("remark")
//    @Excel(name = "备注", type = Excel.Type.EXPORT)
    private String remark;

    @TableField("create_by")
    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    @TableField("update_by")
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private Date updateTime;

    @TableField(exist = false)
    private String treeAreaCode;

    @TableField(exist = false)
    private String treeLdId;

    @TableField(exist = false)
    private String belongDepartment;

    @TableField(exist = false)
    private Boolean isBound;     //查询条件是否绑定


    @TableField(exist = false)
//    @Excel(name = "门牌号", type = Excel.Type.EXPORT)
    @Excel(name = "门牌号")
    private String roomName;

    @TableField(exist = false)
//    @Excel(name = "协议名称", type = Excel.Type.EXPORT)
    private String protocolName;

    //    @Excel(name = "表类型", type = Excel.Type.EXPORT)
    @TableField(exist = false)
    private String moduleType;

    //    @Excel(name = "楼栋名称", type = Excel.Type.EXPORT)
    @TableField(exist = false)
    private String ldName;

    @TableField(exist = false)
    private String sortBy;

    @TableField(exist = false)
    private Integer areaid;

    @TableField(exist = false)
//    @JsonProperty("AreaName")
    private String AreaName;

    @TableField(exist = false)
    private String searchValue;
    @TableField(exist = false)
    private Integer loginUserId;

    @TableField(exist = false)
    private Integer systemFlag;

    @TableField("communication_type")
    @Excel(name = "通讯类型", dictType = "communication_type", type = Excel.Type.ALL)
    private String communicationType;

    @TableField(exist = false)
    private String communicationTypeName;
    /**
     * 是否绑定集中器
     */
    @TableField(exist = false)
    private Boolean haveConcentrator;
    /**
     * 适用策略
     */
    @TableField("strategy")
    private String strategy;
    /**
     * 适用策略名称
     */
    @Excel(name = "适用策略")
    @TableField(exist = false)
    private String strategyName;

    @TableField(exist = false)
    private String searchSheetsCode;

    @TableField(exist = false)
    private String searchTenantId;

    @TableField(exist = false)
    private String factoryCode;
    /**
     * 表序号
     */
    @TableField("meter_seq")
    private Integer meterSeq;

    /** 能耗分项（从数据字典获取） */
    @Excel(name = "能耗分项", readConverterExp = "从数据字典获取")
    @TableField("energy_use_item")
    private String energyUseItem;

    @TableField(exist = false)
    private Integer areaOrPublicShare;
    @TableField(exist = false)
    private String publicShareId;

    /**
     * 计算类型；1：加；2：减
     */
    @TableField("calc_type")
    private Integer calcType;

    /**
     * 计算比率
     */
    @TableField("calc_rate")
    private Decimal calcRate;


    @TableField(exist = false)
    private String userXbId;

    /**
     *  满转次数
     */
    @TableField("cycles_num")
    private Integer cyclesNum;



}
